package com.smartstate.dataManagement.controller;

import com.smartstate.dataManagement.dto.common.TreeNode;
import com.smartstate.dataManagement.entity.CarbonContribution;
import com.smartstate.dataManagement.entity.Dehumidifier;
import com.smartstate.dataManagement.service.CarbonTraceService;
import com.smartstate.dataManagement.service.DehumidifierService;
import com.smartstate.dataManagement.vo.DehumidifierVO;
import com.smartstate.dataManagement.vo.ResultVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 除湿机控制层
 */
@RestController
@RequestMapping("/Dehumidifier")
public class DehumidifierController {
    @Resource
    private DehumidifierService dehumidifierService;

    @PostMapping("/dehumidifierTree")
    @ApiOperation(value = "中控用除湿机树")
    public  ResultVO<List<DehumidifierVO>> dehumidifierTree(@RequestParam Integer deviceType) {
        List<DehumidifierVO> dehumidifierVOS = dehumidifierService.dehumidifierTree(deviceType);
        return ResultVO.ok(dehumidifierVOS);
    }
}
